Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase test coverage for ListUtils #517

Merged
merged 2 commits into from
Jul 22, 2024

Conversation

sigee
Copy link
Contributor

@sigee sigee commented Jul 19, 2024

  • isEqualList: same size, but different elements in the lists
  • isEqualList: same size, same elements, but different order
  • hashCodeForList: with null element
  • partition.get: edge cases (Exception)
  • union: multiple cases
  • sum: happy path

assertFalse(ListUtils.isEqualList(a, b));
assertFalse(ListUtils.isEqualList(a, null));
assertFalse(ListUtils.isEqualList(null, b));
final List<String> list1 = new ArrayList<>( data );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't rename variables. I can't tell what's changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed them because they overlapped the String constants from lines 46, 47. And they were confusing.

private static final String a = "a";
private static final String b = "b";
final List<String> a = new ArrayList<>( data );
final List<String> b = new ArrayList<>( data );

 - isEqualList: same size, but different elements in the lists
 - isEqualList: same size, same elements, but different order
 - hashCodeForList: with null element
 - partition.get: edge cases (Exception)
 - union: multiple cases
 - sum: happy path
@sigee
Copy link
Contributor Author

sigee commented Jul 22, 2024

I split the changes into two commits to make them more understandable.

  • Increase the coverage
  • Rename local variables

@garydgregory garydgregory merged commit 6c3bba1 into apache:master Jul 22, 2024
7 of 8 checks passed
@garydgregory
Copy link
Member

@sigee
Merged. TY.

garydgregory added a commit that referenced this pull request Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants